/*
 * @Description: 档案备份计划 功能操作组件
 * @Author: Rfan
 * @Date: 2022-08-03 20:29:15
 * @LastEditTime: 2023-03-01 20:29:40
 */

import { Button, Space } from 'antd';
import { useArchiveBasketContext } from '../contexts/ArchiveBasketContext';

const PageOperate = () => {
  const { selectItems, delRecycleItemFunc, clearAll } = useArchiveBasketContext();

  const delSelect = () => {
    delRecycleItemFunc(selectItems);
  };

  return (
    <div className="filter-container">
      <p className="page-title">档案篮列表</p>
      <Space size="small">
        <Button
          disabled={selectItems.length <= 0}
          onClick={() => {
            delSelect();
          }}
        >
          删除
        </Button>
        <Button
          onClick={() => {
            clearAll();
          }}
        >
          一键清空
        </Button>
      </Space>
    </div>
  );
};

export default PageOperate;
